unit EditTranceRmk;

interface

uses
  Winapi.Windows, Winapi.Messages, SysUtils, Variants, Classes, Graphics,
  Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses,
  uniGUIClasses, uniGUIForm, uniButton, uniBitBtn, uniMemo, uniDBMemo, DB,
  DBClient, ClientRowSet, uniLabel, uniGUIBaseClasses, uniEdit, uniDBEdit,
  uniGroupBox, uniMultiItem, uniComboBox, uniDBComboBox, uniDBLookupComboBox,
  uniPanel;

type
  TFrmEditTranceRmk = class(TUniForm)
    dsTrance: TDataSource;
    btSave: TUniBitBtn;
    btClose: TUniBitBtn;
    UniLabel2: TUniLabel;
    UniPanel2: TUniPanel;
    UniPanel4: TUniPanel;
    edBillNo: TUniDBEdit;
    UniPanel5: TUniPanel;
    UniPanel6: TUniPanel;
    edRcvAble: TUniDBEdit;
    UniPanel7: TUniPanel;
    UniPanel8: TUniPanel;
    edCod: TUniDBEdit;
    UniPanel9: TUniPanel;
    UniPanel10: TUniPanel;
    edCustName: TUniDBEdit;
    UniPanel11: TUniPanel;
    UniPanel12: TUniPanel;
    edSendCont: TUniDBEdit;
    UniPanel13: TUniPanel;
    UniPanel14: TUniPanel;
    edSendTel: TUniDBEdit;
    UniPanel15: TUniPanel;
    UniPanel16: TUniPanel;
    edSendAddr: TUniDBEdit;
    edSendCity: TUniDBEdit;
    UniPanel17: TUniPanel;
    UniPanel18: TUniPanel;
    cbFetchEmp: TUniDBLookupComboBox;
    UniPanel19: TUniPanel;
    UniPanel20: TUniPanel;
    edOrderNo: TUniDBEdit;
    UniPanel21: TUniPanel;
    UniPanel22: TUniPanel;
    cbPayside: TUniDBLookupComboBox;
    UniPanel23: TUniPanel;
    UniPanel24: TUniPanel;
    cbState: TUniDBLookupComboBox;
    UniPanel25: TUniPanel;
    UniPanel26: TUniPanel;
    cbDispEmp: TUniDBLookupComboBox;
    UniPanel27: TUniPanel;
    UniPanel28: TUniPanel;
    cbDestNode: TUniDBLookupComboBox;
    UniPanel41: TUniPanel;
    UniPanel42: TUniPanel;
    edRemark: TUniDBMemo;
    UniPanel1: TUniPanel;
    UniPanel3: TUniPanel;
    edDestName: TUniDBEdit;
    UniPanel29: TUniPanel;
    UniPanel30: TUniPanel;
    edDestCont: TUniDBEdit;
    UniPanel31: TUniPanel;
    UniPanel32: TUniPanel;
    edDestTel: TUniDBEdit;
    UniPanel33: TUniPanel;
    UniPanel34: TUniPanel;
    edDestAddr: TUniDBEdit;
    edDstCity: TUniDBEdit;
    UniLabel1: TUniLabel;
    UniPanel35: TUniPanel;
    UniPanel36: TUniPanel;
    edCargo: TUniDBEdit;
    UniPanel37: TUniPanel;
    UniPanel38: TUniPanel;
    edCount: TUniDBEdit;
    UniPanel39: TUniPanel;
    UniPanel40: TUniPanel;
    edWeight: TUniDBEdit;
    UniPanel43: TUniPanel;
    UniPanel44: TUniPanel;
    cbSendNode: TUniDBLookupComboBox;
    UniPanel45: TUniPanel;
    UniPanel46: TUniPanel;
    edCrtDate: TUniDBEdit;
    UniPanel47: TUniPanel;
    UniPanel48: TUniPanel;
    edFeeAccNo: TUniDBEdit;
    UniPanel49: TUniPanel;
    UniPanel50: TUniPanel;
    edCodFee: TUniDBEdit;
    UniPanel51: TUniPanel;
    edAdvfee: TUniDBEdit;
    UniPanel52: TUniPanel;
    crsOrder: TClientRowSet;
    crsOrderORDER_ID: TStringField;
    crsOrderCON_ORDID: TStringField;
    crsOrderBILL_NO: TStringField;
    crsOrderORDER_NO: TStringField;
    crsOrderORDER_TYPE: TStringField;
    crsOrderTSP_STATE: TIntegerField;
    crsOrderACPT_STATE: TIntegerField;
    crsOrderCARGO: TStringField;
    crsOrderCARGO_CNT: TIntegerField;
    crsOrderWEIGHT: TFloatField;
    crsOrderVOLUME: TStringField;
    crsOrderDISTANCE: TFloatField;
    crsOrderCOD: TFloatField;
    crsOrderCOD_FEE: TFloatField;
    crsOrderCOD_BLCID: TStringField;
    crsOrderCOD_STATE: TIntegerField;
    crsOrderASK_RTBILL: TIntegerField;
    crsOrderSEND_PNTNO: TStringField;
    crsOrderSEND_GROUP: TStringField;
    crsOrderSEND_NODE: TStringField;
    crsOrderSEND_NAME: TStringField;
    crsOrderSEND_TEL: TStringField;
    crsOrderSEND_CONT: TStringField;
    crsOrderSEND_CITY: TStringField;
    crsOrderSEND_ADDR: TStringField;
    crsOrderDEST_PNTNO: TStringField;
    crsOrderDEST_GROUP: TStringField;
    crsOrderDEST_NODE: TStringField;
    crsOrderDEST_NAME: TStringField;
    crsOrderDEST_TEL: TStringField;
    crsOrderDEST_CONT: TStringField;
    crsOrderDEST_CITY: TStringField;
    crsOrderDEST_ADDR: TStringField;
    crsOrderRECEIVER: TStringField;
    crsOrderTSP_ACCNO: TStringField;
    crsOrderTSP_PNTNO: TStringField;
    crsOrderTSP_GROUP: TStringField;
    crsOrderTSP_NODE: TStringField;
    crsOrderTSP_NAME: TStringField;
    crsOrderTSP_EMPTEL: TStringField;
    crsOrderTRUCK_NO: TStringField;
    crsOrderTSP_TEL: TStringField;
    crsOrderTSP_EMPNO: TStringField;
    crsOrderTSP_EMPNAME: TStringField;
    crsOrderTSP_USRNO: TStringField;
    crsOrderFETCH_NODE: TStringField;
    crsOrderFETCH_EMPNO: TStringField;
    crsOrderFETCH_EMPNAME: TStringField;
    crsOrderFETCH_EMPTEL: TStringField;
    crsOrderFETCH_NODE_INC: TFloatField;
    crsOrderDISP_NODE: TStringField;
    crsOrderDISP_EMPNO: TStringField;
    crsOrderDISP_EMPNAME: TStringField;
    crsOrderDISP_EMPTEL: TStringField;
    crsOrderDISP_NODE_INC: TFloatField;
    crsOrderRECBILL_NAME: TStringField;
    crsOrderFEE_BLCID: TStringField;
    crsOrderFETCH_BLCID: TStringField;
    crsOrderDISP_BLCID: TStringField;
    crsOrderFEE: TFloatField;
    crsOrderPAYSIDE: TIntegerField;
    crsOrderADV_FEE: TFloatField;
    crsOrderINUS_FEE: TFloatField;
    crsOrderFEE_STATE: TIntegerField;
    crsOrderDLIV_PAYIN: TFloatField;
    crsOrderBACK_FEE: TFloatField;
    crsOrderCRT_DATE: TStringField;
    crsOrderSND_DATE: TStringField;
    crsOrderARV_DATE: TStringField;
    crsOrderRCV_TIME: TStringField;
    crsOrderEXCEPT_INFO: TStringField;
    crsOrderREMARK: TStringField;
    crsOrderGROUP_CODE: TStringField;
    crsOrderNODE_NO: TStringField;
    crsOrderNODE_NAME: TStringField;
    crsOrderSYS_ACCOUNT: TStringField;
    crsOrderUPDATETIME: TStringField;
    crsOrderVERSION: TLargeintField;
    crsOrderFEE_ACCNO: TStringField;
    crsOrderSEND_CARDNO: TStringField;
    crsOrderDEST_CARDNO: TStringField;
    crsOrderPROC_STATE: TStringField;
    crsOrderLKPAYSIDE: TStringField;
    crsOrderLKFEESTATE: TStringField;
    crsOrderINCOME: TFloatField;
    dsOrder: TDataSource;
    dsEmp: TDataSource;
    dsComp: TDataSource;
    dsState: TDataSource;
    dsNode: TDataSource;
    dsPayside: TDataSource;
    crsNode: TClientRowSet;
    crsdstNode: TClientRowSet;
    dsdstNode: TDataSource;
    procedure btCloseClick(Sender: TObject);
    procedure btSaveClick(Sender: TObject);
    procedure UniFormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure ShowOrderInfo(billNo: string);
  end;

function FrmEditTranceRmk: TFrmEditTranceRmk;

implementation

{$R *.dfm}

uses
  MainModule, uniGUIApplication, uCommFunction, ExpModule, DictModule;

function FrmEditTranceRmk: TFrmEditTranceRmk;
begin
  Result := TFrmEditTranceRmk(UniMainModule.GetFormInstance(TFrmEditTranceRmk));
end;

procedure TFrmEditTranceRmk.btCloseClick(Sender: TObject);
begin
  dsTrance.DataSet.Cancel;
  self.Close;
end;

procedure TFrmEditTranceRmk.btSaveClick(Sender: TObject);
begin
  TClientRowSet(dsTrance.DataSet).Post;
  TClientRowSet(dsTrance.DataSet).ApplyUpdates;
  self.Close;
end;

procedure TFrmEditTranceRmk.ShowOrderInfo(billNo: string);
var
  SQLText: string;
begin
  SQLText := 'SELECT * FROM tsp_order WHERE group_code=' + QuotedStr(dmExpress.UserInfo.GroupCode) +
    ' AND bill_no=' + QuotedStr(billNo);
  crsOrder.Close;
  crsOrder.CommandText := SQLText;
  crsOrder.Open;
end;

procedure TFrmEditTranceRmk.UniFormCreate(Sender: TObject);
begin
  SetCompoentLanguage(Self);
  crsNode.Data := dmDict.crsNode.Data;
  crsdstNode.Data := dmDict.crsNode.Data;
end;

end.
